var um;
$(function(){
	$('.emotion').qqFace({

		id : 'facebox', 

		assign:'saytext', 

		path:'images/arclist/'	//表情存放的路径

	});
	function isIos() {
		var u = navigator.userAgent;
		// var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
		var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
		return isiOS;
	}

	/**
	 * 初始化输入框
	 */
	function initUm(opts, onblur, onfocus, onClick) {
		um = UM.getEditor('myEditor', opts || {});
		um.addListener('blur', onblur|| function(){
			$(".edui-container").removeClass("edui-container-focus");
			$("#addExp").css("visibility", "hidden");
			if(isIos()){
				wrapper.enable();
			}
		});

		setTimeout(function () {
			um.focus();
		},1000);

		um.addListener('keyup', function(evt) {
			// showSend();
		})
	}
	initUm()
	/**
	 * 插入数据
	 * @param html
	 */
	function insertHtml(html) {
		// debugger
		um.execCommand('insertHtml', html)

		//清空
		// um.setContent('', false);

		//获取内容
		// var msg = um.getContent();
	}

	window.insertHtml = insertHtml
});